import React from 'react'
import { useNavigate } from 'react-router-dom';

export default function My() {
  const navigate = useNavigate();
  return (
    <div>我的个人中心界面
      <p>欢迎{localStorage.getItem('userName')}的到来</p>
      <button onClick={() => {
        localStorage.clear();
        navigate('/login')
      }}>
        退出登录
      </button>
    </div>
  )
}
